﻿using System;
using Core.Extension;
using Core.Mgr._EventSys;
using UnityEngine;

namespace Logic.Global
{
    /// 用户输入管理器
    public class InputMgr : MonoBehaviour
    {

        public static Action OnMouseBtnDown;

        public static Action OnMouseBtn;

        public static Action OnMouseBtnUp;


        private void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                OnMouseBtnDown?.Invoke();
                OnMouseBtnDown = null;
            }

            if (Input.GetMouseButtonUp(0))
            {
                OnMouseBtnUp?.Invoke();
                OnMouseBtnUp = null;
            }

            if (Input.GetMouseButton(0))
            {
                OnMouseBtn?.Invoke();
                OnMouseBtn = null;
            }
        }
    }
}